<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Gazell Link Layer Device with Payload in ACK</title>
<link href="tabs.css" rel="stylesheet" type="text/css" />
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="alias.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="alias.js"></script>

<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>



<script type="text/javascript">
  jQuery(document).ready(function () {
    if(gref){ // Number all _img and _table classes
      gref();
    }
  });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nRF Gazell
   &#160;<span id="projectnumber">version 0.4.2</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group__gzll__device__ack__payload__example.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Gazell Link Layer Device with Payload in ACK</div>  </div>
<div class="ingroups"><a class="el" href="group__gzll__03__examples.html">Example Projects</a></div></div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gzll__device__ack__payload__example.html#gae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function.  <a href="#gae66f6b31b5ad750f1fe042a706a4e3d4"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Configuration</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1b254eba12826664994a6c1be0279b30"></a><!-- doxytag: member="gzll_device_ack_payload_example::data_payload" ref="ga1b254eba12826664994a6c1be0279b30" args="[1]" -->
static uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gzll__device__ack__payload__example.html#ga1b254eba12826664994a6c1be0279b30">data_payload</a> [1]</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Payload to send to Host. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gabeaede42f5ae274be752a8cee2295d47"></a><!-- doxytag: member="gzll_device_ack_payload_example::ack_payload" ref="gabeaede42f5ae274be752a8cee2295d47" args="[32]" -->
static uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gzll__device__ack__payload__example.html#gabeaede42f5ae274be752a8cee2295d47">ack_payload</a> [32]</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Placeholder for received ACK payloads from Host. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa85c7fd336ea69efa2b6eaef4d412339"></a><!-- doxytag: member="gzll_device_ack_payload_example::init_ok" ref="gaa85c7fd336ea69efa2b6eaef4d412339" args="" -->
static volatile bool&#160;</td><td class="memItemRight" valign="bottom"><b>init_ok</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad09d97330b821b01fcdd4e1c0397c7cd"></a><!-- doxytag: member="gzll_device_ack_payload_example::enable_ok" ref="gad09d97330b821b01fcdd4e1c0397c7cd" args="" -->
static volatile bool&#160;</td><td class="memItemRight" valign="bottom"><b>enable_ok</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5f0e322b7017d399060de529d624cab9"></a><!-- doxytag: member="gzll_device_ack_payload_example::push_ok" ref="ga5f0e322b7017d399060de529d624cab9" args="" -->
static volatile bool&#160;</td><td class="memItemRight" valign="bottom"><b>push_ok</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gacdc89181c410eddb7126fd218e925d4e"></a><!-- doxytag: member="gzll_device_ack_payload_example::pop_ok" ref="gacdc89181c410eddb7126fd218e925d4e" args="" -->
static volatile bool&#160;</td><td class="memItemRight" valign="bottom"><b>pop_ok</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga87897a439ee5c278ee7cccf687536086"></a><!-- doxytag: member="gzll_device_ack_payload_example::tx_success" ref="ga87897a439ee5c278ee7cccf687536086" args="" -->
static volatile bool&#160;</td><td class="memItemRight" valign="bottom"><b>tx_success</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae28843c923b3481f8a94798e7ccba523"></a><!-- doxytag: member="gzll_device_ack_payload_example::PIPE_NUMBER" ref="gae28843c923b3481f8a94798e7ccba523" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gzll__device__ack__payload__example.html#gae28843c923b3481f8a94798e7ccba523">PIPE_NUMBER</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">We use pipe 0 in this example. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2a2f690f8bdeeb4003203ff5e3edaffc"></a><!-- doxytag: member="gzll_device_ack_payload_example::BUTTONS" ref="ga2a2f690f8bdeeb4003203ff5e3edaffc" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gzll__device__ack__payload__example.html#ga2a2f690f8bdeeb4003203ff5e3edaffc">BUTTONS</a>&#160;&#160;&#160;NRF_GPIO_PORT_SELECT_PORT0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">GPIO port for reading from buttons. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga61686d33603491344883775b9b31e172"></a><!-- doxytag: member="gzll_device_ack_payload_example::LEDS" ref="ga61686d33603491344883775b9b31e172" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gzll__device__ack__payload__example.html#ga61686d33603491344883775b9b31e172">LEDS</a>&#160;&#160;&#160;NRF_GPIO_PORT_SELECT_PORT1</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">GPIO port for writing to LEDs. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaed1097d348540e6d609ced933dfaa26b"></a><!-- doxytag: member="gzll_device_ack_payload_example::TX_PAYLOAD_LENGTH" ref="gaed1097d348540e6d609ced933dfaa26b" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gzll__device__ack__payload__example.html#gaed1097d348540e6d609ced933dfaa26b">TX_PAYLOAD_LENGTH</a>&#160;&#160;&#160;1</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">We use 1 byte payload length when transmitting. <br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Gazell callback function definitions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gzll__device__ack__payload__example.html#gac1306762dc2ccfc5c2bbdbe2d85a93aa">nrf_gzll_device_tx_success</a> (uint32_t pipe, <a class="el" href="structnrf__gzll__device__tx__info__t.html">nrf_gzll_device_tx_info_t</a> tx_info)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">ACK received callback (Device mode only).  <a href="#gac1306762dc2ccfc5c2bbdbe2d85a93aa"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gzll__device__ack__payload__example.html#ga0642fed399ed3ec41406cd4323edf5ad">nrf_gzll_device_tx_failed</a> (uint32_t pipe, <a class="el" href="structnrf__gzll__device__tx__info__t.html">nrf_gzll_device_tx_info_t</a> tx_info)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Transmission failed callback (Device mode only).  <a href="#ga0642fed399ed3ec41406cd4323edf5ad"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gzll__device__ack__payload__example.html#ga116b8ce684c3f6fe8c63c371b913aa3e">nrf_gzll_host_rx_data_ready</a> (uint32_t pipe, <a class="el" href="structnrf__gzll__host__rx__info__t.html">nrf_gzll_host_rx_info_t</a> rx_info)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Data packet received callback (Host mode only).  <a href="#ga116b8ce684c3f6fe8c63c371b913aa3e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__gzll__device__ack__payload__example.html#ga70d3a691deff3748a4a8a17a2feceec2">nrf_gzll_disabled</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disabled callback.  <a href="#ga70d3a691deff3748a4a8a17a2feceec2"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>This project requires that a Host running the <a class="el" href="group__gzll__host__ack__payload__example.html">Gazell Link Layer Host with Payload in ACK</a> example be used as a counterpart for receiving the data. This can be on either nRF51 device or a nRF24Lxx device running the <b>gzll_host_ack_payload</b> example in the nRFgo SDK.</p>
<p>This example sends a packet and adds a new packet to the TX queue every time it receives an ACK. Before adding a packet to the TX queue, the contents of the GPIO Port BUTTONS is copied to the first payload byte (byte 0). When an ACK is received, the contents of the first payload byte of the ACK are output on GPIO Port LEDS. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gae66f6b31b5ad750f1fe042a706a4e3d4"></a><!-- doxytag: member="main_device_ack_payload.c::main" ref="gae66f6b31b5ad750f1fe042a706a4e3d4" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Main function. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>ANSI required int return type. </dd></dl>

<p>Definition at line <a class="el" href="main__device__ack__payload_8c_source.html#l00071">71</a> of file <a class="el" href="main__device__ack__payload_8c_source.html">main_device_ack_payload.c</a>.</p>
<div class="fragment"><pre class="fragment">{
    uint8_t debug_led_output;

    <span class="comment">// Setup port directions</span>
    <a class="code" href="group__nrf__gpio.html#gaaa72c88a2a29927a1eeff691d6a21afc" title="Set the direction of a port.">nrf_gpio_port_dir_set</a>(<a class="code" href="group__gzll__device__ack__payload__example.html#ga2a2f690f8bdeeb4003203ff5e3edaffc" title="GPIO port for reading from buttons.">BUTTONS</a>, <a class="code" href="group__nrf__gpio.html#gga494d7ac30db1cbb6366e0b9ebd5b49b4a6ec5811669635e30b9dc014e1f494936" title="Input.">NRF_GPIO_PORT_DIR_INPUT</a>);
    <a class="code" href="group__nrf__gpio.html#gaaa72c88a2a29927a1eeff691d6a21afc" title="Set the direction of a port.">nrf_gpio_port_dir_set</a>(<a class="code" href="group__gzll__device__ack__payload__example.html#ga61686d33603491344883775b9b31e172" title="GPIO port for writing to LEDs.">LEDS</a>, <a class="code" href="group__nrf__gpio.html#gga494d7ac30db1cbb6366e0b9ebd5b49b4a90b7ce7a76775cb7534487635755be3f" title="Output.">NRF_GPIO_PORT_DIR_OUTPUT</a>);

    <span class="comment">// Initialize Gazell</span>
    init_ok = <a class="code" href="group__gzll__02__api.html#gacba07d9c893b4673c563ced97cccba94" title="Initialize Gazell.">nrf_gzll_init</a>(<a class="code" href="group__gzll__02__api.html#gga2321f5573e2cd70651559e6380433edaaf43e2f82283221e9ecacaca178934e47" title="Device mode.">NRF_GZLL_MODE_DEVICE</a>);
    
    <span class="comment">// Attempt sending every packet up to 100 times    </span>
    init_ok &amp;= <a class="code" href="group__gzll__02__api.html#ga6e1c4ec6c4f7acf92a97bffbb6b89333" title="Set the maximum number of TX attempts that can be used for a single packet.">nrf_gzll_set_max_tx_attempts</a>(100);

    <span class="comment">// Load data into TX queue</span>
    <a class="code" href="group__gzll__device__ack__payload__example.html#ga1b254eba12826664994a6c1be0279b30" title="Payload to send to Host.">data_payload</a>[0] = <a class="code" href="group__nrf__gpio.html#ga40bee84dc81b9f8981eb2647dac9d267" title="Read GPIO port.">nrf_gpio_port_read</a>(<a class="code" href="group__gzll__device__ack__payload__example.html#ga2a2f690f8bdeeb4003203ff5e3edaffc" title="GPIO port for reading from buttons.">BUTTONS</a>);  
    push_ok = <a class="code" href="group__gzll__02__api.html#ga1c0b1d1838e032af28c35d7c3e0603e0" title="Add a packet to the tail of the TX FIFO.">nrf_gzll_add_packet_to_tx_fifo</a>(<a class="code" href="group__gzll__device__ack__payload__example.html#gae28843c923b3481f8a94798e7ccba523" title="We use pipe 0 in this example.">PIPE_NUMBER</a>, <a class="code" href="group__gzll__device__ack__payload__example.html#ga1b254eba12826664994a6c1be0279b30" title="Payload to send to Host.">data_payload</a>, <a class="code" href="group__gzll__device__ack__payload__example.html#gaed1097d348540e6d609ced933dfaa26b" title="We use 1 byte payload length when transmitting.">TX_PAYLOAD_LENGTH</a>);
    
    <span class="comment">// Enable Gazell to start sending over the air</span>
    enable_ok = <a class="code" href="group__gzll__02__api.html#gadfb1003b245b019481334e6d087f928e" title="Enable Gazell.">nrf_gzll_enable</a>();         

    <span class="keywordflow">while</span>(1)
    {
        <span class="comment">// Error handling</span>
        debug_led_output = ((uint8_t)tx_success &lt;&lt; 4) | ((uint8_t)pop_ok &lt;&lt; 3) | ((uint8_t)push_ok &lt;&lt; 2) | ((uint8_t)enable_ok &lt;&lt; 1) | (uint8_t)init_ok;                
        
        <span class="comment">// If an error has occured</span>
        <span class="keywordflow">if</span>(debug_led_output != 0x1F)
        {
            <a class="code" href="group__nrf__gpio.html#gac1d4940bc5ad4aad4f6363c7021b08ae" title="Write GPIO port.">nrf_gpio_port_write</a>(<a class="code" href="group__gzll__device__ack__payload__example.html#ga61686d33603491344883775b9b31e172" title="GPIO port for writing to LEDs.">LEDS</a>,0xFF);      
            nrf_delay_us(1000000); <span class="comment">// 1 second delay </span>
            <a class="code" href="group__nrf__gpio.html#gac1d4940bc5ad4aad4f6363c7021b08ae" title="Write GPIO port.">nrf_gpio_port_write</a>(<a class="code" href="group__gzll__device__ack__payload__example.html#ga61686d33603491344883775b9b31e172" title="GPIO port for writing to LEDs.">LEDS</a>, debug_led_output);
            nrf_delay_us(1000000); <span class="comment">// 1 second delay </span>
            <a class="code" href="group__nrf__gpio.html#gac1d4940bc5ad4aad4f6363c7021b08ae" title="Write GPIO port.">nrf_gpio_port_write</a>(<a class="code" href="group__gzll__device__ack__payload__example.html#ga61686d33603491344883775b9b31e172" title="GPIO port for writing to LEDs.">LEDS</a>,0xF0 + (uint32_t)<a class="code" href="group__gzll__02__api.html#gab36bed58f70b88b8fede5d3d8fa3f1c7" title="Gets the Gazell error code.">nrf_gzll_get_error_code</a>()); 
            nrf_delay_us(1000000); <span class="comment">// 1 second delay </span>
        }

        <span class="comment">// Optionally send the CPU to sleep while waiting for a callback.</span>
        <span class="comment">// __WFI();</span>
    }
}
</pre></div>
</div>
</div>
<a class="anchor" id="gac1306762dc2ccfc5c2bbdbe2d85a93aa"></a><!-- doxytag: member="main_device_ack_payload.c::nrf_gzll_device_tx_success" ref="gac1306762dc2ccfc5c2bbdbe2d85a93aa" args="(uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void nrf_gzll_device_tx_success </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pipe</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structnrf__gzll__device__tx__info__t.html">nrf_gzll_device_tx_info_t</a>&#160;</td>
          <td class="paramname"><em>tx_info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>ACK received callback (Device mode only). </p>
<p>This callback is made when the Device receives an ACK (acknowledgement) packet. </p>
<dl class="see"><dt><b>See also:</b></dt><dd>nrf_gzll_ack_payload_received.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pipe</td><td>is the pipe on which an ACK packet was received. </td></tr>
    <tr><td class="paramname">tx_info</td><td>struct used to indicate whether a payload was received in the ack, as well as the number of TX attempts and channel switches required. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="main__device__ack__payload_8c_source.html#l00120">120</a> of file <a class="el" href="main__device__ack__payload_8c_source.html">main_device_ack_payload.c</a>.</p>
<div class="fragment"><pre class="fragment">{
    uint32_t ack_payload_length = <a class="code" href="group__gzll__02__api.html#ga8b684b647780717d25ff16f1a42e166f" title="Maximum allowed payload length in bytes.">NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH</a>;    
    tx_success = <span class="keyword">true</span>;

    <span class="keywordflow">if</span> (tx_info.<a class="code" href="structnrf__gzll__device__tx__info__t.html#a82d823d6abc51dc89fd4735decec9149" title="A payload was received in the ACK.">payload_received_in_ack</a>)
    {
        <span class="comment">// Pop packet and write first byte of the payload to the GPIO port.</span>
        pop_ok = <a class="code" href="group__gzll__02__api.html#ga419c8ce6a3e08d5dec8b50ef88b3cc2b" title="Fetch a packet from the head of the RX FIFO.">nrf_gzll_fetch_packet_from_rx_fifo</a>(pipe, <a class="code" href="group__gzll__device__ack__payload__example.html#gabeaede42f5ae274be752a8cee2295d47" title="Placeholder for received ACK payloads from Host.">ack_payload</a>, &amp;ack_payload_length);
        <span class="keywordflow">if</span> (ack_payload_length &gt; 0)
        {
            <a class="code" href="group__nrf__gpio.html#gac1d4940bc5ad4aad4f6363c7021b08ae" title="Write GPIO port.">nrf_gpio_port_write</a>(<a class="code" href="group__gzll__device__ack__payload__example.html#ga61686d33603491344883775b9b31e172" title="GPIO port for writing to LEDs.">LEDS</a>, ~<a class="code" href="group__gzll__device__ack__payload__example.html#gabeaede42f5ae274be752a8cee2295d47" title="Placeholder for received ACK payloads from Host.">ack_payload</a>[0]);  <span class="comment">// Button press is active low. </span>
        }
    }
    
    <span class="comment">// Read buttons and load data payload into TX queue</span>
    <a class="code" href="group__gzll__device__ack__payload__example.html#ga1b254eba12826664994a6c1be0279b30" title="Payload to send to Host.">data_payload</a>[0] = <a class="code" href="group__nrf__gpio.html#ga40bee84dc81b9f8981eb2647dac9d267" title="Read GPIO port.">nrf_gpio_port_read</a>(<a class="code" href="group__gzll__device__ack__payload__example.html#ga2a2f690f8bdeeb4003203ff5e3edaffc" title="GPIO port for reading from buttons.">BUTTONS</a>);
    push_ok = <a class="code" href="group__gzll__02__api.html#ga1c0b1d1838e032af28c35d7c3e0603e0" title="Add a packet to the tail of the TX FIFO.">nrf_gzll_add_packet_to_tx_fifo</a>(pipe, <a class="code" href="group__gzll__device__ack__payload__example.html#ga1b254eba12826664994a6c1be0279b30" title="Payload to send to Host.">data_payload</a>, <a class="code" href="group__gzll__device__ack__payload__example.html#gaed1097d348540e6d609ced933dfaa26b" title="We use 1 byte payload length when transmitting.">TX_PAYLOAD_LENGTH</a>);
}
</pre></div>
</div>
</div>
<a class="anchor" id="ga0642fed399ed3ec41406cd4323edf5ad"></a><!-- doxytag: member="main_device_ack_payload.c::nrf_gzll_device_tx_failed" ref="ga0642fed399ed3ec41406cd4323edf5ad" args="(uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void nrf_gzll_device_tx_failed </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pipe</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structnrf__gzll__device__tx__info__t.html">nrf_gzll_device_tx_info_t</a>&#160;</td>
          <td class="paramname"><em>tx_info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Transmission failed callback (Device mode only). </p>
<p>This callback is made when a packet does not receive an ACK after nrf_gzll_max_retries is reached. The packet is deleted by Gazell.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pipe</td><td>is the pipe on which the transmission failed. </td></tr>
    <tr><td class="paramname">tx_info</td><td>struct used to indicate whether a payload was received in the ack, as well as RSSI and the number of TX attempts and channel switches required. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="main__device__ack__payload_8c_source.html#l00145">145</a> of file <a class="el" href="main__device__ack__payload_8c_source.html">main_device_ack_payload.c</a>.</p>
<div class="fragment"><pre class="fragment">{
    tx_success = <span class="keyword">false</span>;

    <span class="comment">// Load data into TX queue</span>
    <a class="code" href="group__gzll__device__ack__payload__example.html#ga1b254eba12826664994a6c1be0279b30" title="Payload to send to Host.">data_payload</a>[0] = <a class="code" href="group__nrf__gpio.html#ga40bee84dc81b9f8981eb2647dac9d267" title="Read GPIO port.">nrf_gpio_port_read</a>(<a class="code" href="group__gzll__device__ack__payload__example.html#ga2a2f690f8bdeeb4003203ff5e3edaffc" title="GPIO port for reading from buttons.">BUTTONS</a>);
    push_ok = <a class="code" href="group__gzll__02__api.html#ga1c0b1d1838e032af28c35d7c3e0603e0" title="Add a packet to the tail of the TX FIFO.">nrf_gzll_add_packet_to_tx_fifo</a>(pipe, <a class="code" href="group__gzll__device__ack__payload__example.html#ga1b254eba12826664994a6c1be0279b30" title="Payload to send to Host.">data_payload</a>, <a class="code" href="group__gzll__device__ack__payload__example.html#gaed1097d348540e6d609ced933dfaa26b" title="We use 1 byte payload length when transmitting.">TX_PAYLOAD_LENGTH</a>);
}
</pre></div>
</div>
</div>
<a class="anchor" id="ga116b8ce684c3f6fe8c63c371b913aa3e"></a><!-- doxytag: member="main_device_ack_payload.c::nrf_gzll_host_rx_data_ready" ref="ga116b8ce684c3f6fe8c63c371b913aa3e" args="(uint32_t pipe, nrf_gzll_host_rx_info_t rx_info)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void nrf_gzll_host_rx_data_ready </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pipe</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structnrf__gzll__host__rx__info__t.html">nrf_gzll_host_rx_info_t</a>&#160;</td>
          <td class="paramname"><em>rx_info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Data packet received callback (Host mode only). </p>
<p>This callback is made when a Host receives a data packet from a Device.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pipe</td><td>is the pipe on which the data packet was received. </td></tr>
    <tr><td class="paramname">rx_info</td><td>struct used to indicate whether a payload was removed from the pipe's TX FIFO, as well as RSSI. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="main__device__ack__payload_8c_source.html#l00157">157</a> of file <a class="el" href="main__device__ack__payload_8c_source.html">main_device_ack_payload.c</a>.</p>
<div class="fragment"><pre class="fragment">{}
</pre></div>
</div>
</div>
<a class="anchor" id="ga70d3a691deff3748a4a8a17a2feceec2"></a><!-- doxytag: member="main_device_ack_payload.c::nrf_gzll_disabled" ref="ga70d3a691deff3748a4a8a17a2feceec2" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void nrf_gzll_disabled </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Disabled callback. </p>
<p>This is called after Gazell enters the disabled state. There is no further CPU use by Gazell, the radio is disabled and the timer is powered down. </p>

<p>Definition at line <a class="el" href="main__device__ack__payload_8c_source.html#l00159">159</a> of file <a class="el" href="main__device__ack__payload_8c_source.html">main_device_ack_payload.c</a>.</p>
<div class="fragment"><pre class="fragment">{}
</pre></div>
</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>

    <li class="footer">
      Copyright &copy 2006-2011 <a href="http://www.nordicsemi.no" style="text-decoration:none">Nordic Semiconductor</a>.
      All Rights Reserved.
      <a href="disclaimer.html">Disclaimer</a>
    </li>
   </ul>
 </div>


</body>
</html>
